package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Whattoexpectlist;
import com.ean.backpack.repository.WhattoexpectlistRepository;
import com.ean.backpack.service.WhattoexpectlistService;

@Service
@Transactional
public class WhattoexpectlistServiceImpl implements WhattoexpectlistService {

	@Autowired
	private WhattoexpectlistRepository whattoexpectlistRepository;

	public long countAllWhattoexpectlists() {
		return whattoexpectlistRepository.count();
	}

	public void deleteWhattoexpectlist(Whattoexpectlist whattoexpectlist) {
		whattoexpectlistRepository.delete(whattoexpectlist);
	}

	public Whattoexpectlist findWhattoexpectlist(Integer id) {
		return whattoexpectlistRepository.findOne(id);
	}

	public List<Whattoexpectlist> findAllWhattoexpectlists() {
		return whattoexpectlistRepository.findAll();
	}

	public List<Whattoexpectlist> findWhattoexpectlistEntries(int firstResult,
			int maxResults) {
		return whattoexpectlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveWhattoexpectlist(Whattoexpectlist whattoexpectlist) {
		whattoexpectlistRepository.save(whattoexpectlist);
	}

	public Whattoexpectlist updateWhattoexpectlist(
			Whattoexpectlist whattoexpectlist) {
		return whattoexpectlistRepository.save(whattoexpectlist);
	}
}
